#!/usr/bin/env bash

echo "begin install mongodb "
sudo echo "[mongodb-org-3.2]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.2/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.2.asc" >> /etc/yum.repos.d/MongoDB.repo

echo "downloading nginx ..."
sudo echo "[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/$releasever/$basearch/
gpgcheck=0
enabled=1" >> /etc/yum.repos.d/nginx.repo

echo "nodejs v6 ..."
curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash -

sudo yum clean all && sudo yum makecache
sudo yum install -y mongodb-org
sudo yum install nginx -y
sudo yum -y install nodejs

sudo bash ../common/dev-web-install.sh